#include "pcmaccencode.h"

PCMACCEncode::PCMACCEncode(QObject *parent) : QThread(parent)
{
    connect(this,&QThread::finished,this,&QThread::deleteLater);
}

PCMACCEncode::~PCMACCEncode()
{

    disconnect();

    requestInterruption();

    quit();

    wait();

    qDebug() << "PCM ACC encode destroy";
}

void PCMACCEncode::run()
{
    PCMSpec pcmSpec;

    pcmSpec.channelLayout = AV_CH_LAYOUT_STEREO;
    pcmSpec.sampleFormat = AV_SAMPLE_FMT_S16;
    pcmSpec.sampleRate = 48000;
    pcmSpec.inFilePath = "/Users/apple/Documents/ffmpeg/qt/audio/recode_pcm_48000_2_16.pcm";
    pcmSpec.outFilePath = "/Users/apple/Documents/ffmpeg/qt/audio/recode_pcm_48000_2_16_again.aac";

    FFMEPGUtils::pcmAACEncode(pcmSpec);

}





